'use strict';

const axios = require('axios');

const BASE_URL = process.env.BASE_URL ? process.env.BASE_URL : 'https://service-4e1ty0dp-1300042482.bj.apigw.tencentcs.com/release';
console.log('BASE_URL', BASE_URL)

const request = axios.create({
    baseURL: BASE_URL,
    timeout: 5000,
});

request.interceptors.response.use(
    response => {
        return response.data;
    },
    error => {
        return Promise.resolve(error);
    }
);

module.exports = request;
